Crate leptos_config

source ·

Modules

Structs

A Struct to allow us to parse LeptosOptions from the file. Not really needed, most interactions should occur with LeptosOptions
This struct serves as a convenient place to store details used for configuring Leptos. It’s used in our actix and axum integrations to generate the correct path for WASM, JS, and Websockets, as well as other configuration tasks. It shares keys with cargo-leptos, to allow for easy interoperability

Enums

An enum that can be used to define the environment Leptos is running in. Setting this to the PROD variant will not include the WebSocket code for cargo-leptos watch mode. Defaults to DEV.

Functions

Loads LeptosOptions from a Cargo.toml with layered overrides. If an env var is specified, like LEPTOS_ENV, it will override a setting in the file. It takes in an optional path to a Cargo.toml file. If None is provided, you’ll need to set the options as environment variables or rely on the defaults. This is the preferred approach for cargo-leptos. If Some(“./Cargo.toml”) is provided, Leptos will read in the settings itself. This option currently does not allow dashes in file or foldernames, as all dashes become underscores